<?

class modSOCIAL extends MOD {

	function __construct( $vars ) {

		$this->_addvars( $vars );
		$this->_ref();
	}


#	Output function
	function output() { 

		if( $this->action )
			$result = $this->{ "filter_" . $this->action }();
		
		$this->addclass( $this->action );
	
		return $this->parse( $result ) . $this->render_js();
	}


#	Remove double occurences.
	function distinct( $unique, $array_0, $array_1 ) {
		
		$parsed = array();
		foreach(  array_merge( $array_0, $array_1 ) as $tw )
				 
				  $parsed[ $tw->{ $unique }] = $tw;
		return 	  $parsed;
	}


#	Find hashtags in string
	function find_hashtags( $string ) {
		
		preg_match_all ( "/#(\w+)/" , strtolower( $string ), $tags );
		return $tags[ 1 ];	
	}

}

?>